Parse and expose more style JSON root properties#6002
Conversation
|
What properties from |
|
@kkaefer, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @1ec5 and @ansis to be potential reviewers. |
|
@1ec5 This patch parses the properties, but they aren't yet exposed in the SDK. You can obtain the values with Do you have any specific use case for |
There was a problem hiding this comment.
Should this be getStyleName()?
No, I figured this would eventually be opened up to developers, but we can definitely leave it out, especially since the structure is undefined. |
4dc3f33 to
a9eb69e
Compare
|
👍 |
b8e056c to
44736c1
Compare
We're now parsing "name", "center", "zoom", "bearing", and "pitch" from the stylesheet.
44736c1 to
cb33c86
Compare
mbgl::style::Parser::parse()should parse thenameandmetadataroot properties out of the style JSON and expose them with accessors on thembgl::style::Styleclass. The SDK could read the name of the style aloud in accessibility contexts.Similarly, root properties such as
centerandzoommay be useful for establishing a default viewport for the style other than the Null Island default used in the SDK currently. This would enable the developer to set the default viewport once, in Mapbox Studio, and not have to set it again programmatically or in a storyboard./cc @jfirebaugh @kkaefer